{extend name="layout/layout" /}
{block name="pagecss"}
<style>
    table.dataTable.no-footer {
        border-bottom: 0 !important;
    }
    #data-table_processing {
        border: 0 !important;
        position: relative;
    }
    .dataTables_wrapper {
        margin-bottom: 15px;
    }
</style>
<link href="__STATIC__/admin/css/components.css" rel="stylesheet" type="text/css" />
<link href="__STATIC__/admin/pages/css/wxindex.css" rel="stylesheet" type="text/css" />
{/block}

{block name="content"}
<div class="page-content-wrapper">
    <div class="page-content">
        <div class="box box-success">
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet light bordered relative" style="min-height: 750px">
                        <div class="portlet-body">
                            <div id="store">
                                {if condition="$admin.roleType == 2 "}  <!-- 店员登录 -->
                                <select name="storeId" class="form-control" disabled>
                                    {volist name="store" id="vo"}
                                    <option value="{$vo.id}" {eq name="vo.id" value="$admin.storeId"}selected{/eq}  ><span>{$vo.name}</span></option>
                                    {/volist}
                                </select>
                                {else /}
                                <select  name="storeId" class="form-control" style="width: 200px;" onchange="changeStore(this)">
                                    {volist name="store" id="vo"}
                                    <option value="{$vo.id}" {eq name="vo.id" value="$storeId"}selected{/eq}  ><span>{$vo.name}</span></option>
                                    {/volist}
                                </select>
                                {/if}
                            </div>

                            <btton class="btn bg-orange add-module relative" data-toggle="modal" data-target="#add-moduleCon" style="height: 35px;margin-top: 20px">
                                <i class="glyphicon glyphicon-plus"></i> 添加模块
                            </btton>

                            <!-- <div class="sortable"> -->
                            <div id="applet" class="sortable">
                                {volist name="list" id="vo" key="moduleKey"}
                                    {switch name="vo.type" }
                                        {case value="1" }
                                            <!-- 轮播图设置 -->
                                            <div class="col-md-8 ban-site site advertisement" id="list{$key}" >
                                                <input name="componentId" type="hidden" value="" />
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span><button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4 style="color: #000;">轮播图</h4>
                                                <button type="button" class="btn btn-success btn_add_class advertisement_btn" id="advertisement_btn"> 新增轮播广告
                                                </button><span class="help-block text-center" style="color: red"></span>
                                                <table class="table table-ban advertisement_talbe" id="advertisement_talbe{$key}">
                                                    <thead>
                                                    <tr>
                                                        <th>广告图片</th>
                                                        <th>链接类型</th>
                                                        <th>排序</th>
                                                        <th>操作</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    </tbody>
                                                </table>
                                            </div>
                                        {/case}
                                        {case value="2"}
                                            <!--按钮导航设置-->
                                            <div class="col-md-8 btn-nav-site site iconAreaList" id="list{$key}">
                                                <input name="componentId" type="hidden" value="" />
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span><button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4>按钮导航设置</h4>
                                                <div class="form-inline form-group  relative">
                                                    <label class="control-label pull-left">一行显示数：</label>
                                                    <div class="col-md-6 col-xs-7">
                                                        <label class="radio-inline">
                                                      <input type="radio" name="displayType{$key}" value="2" {eq name="vo.displayType" value="2"}checked{/eq} > 两个
                                                    </label>
                                                        <label class="radio-inline">
                                                      <input type="radio" name="displayType{$key}" value="3" {eq name="vo.displayType" value="3"}checked{/eq} > 三个
                                                    </label>
                                                        <label class="radio-inline">
                                                      <input type="radio" name="displayType{$key}" value="4" {eq name="vo.displayType" value="4"}checked{/eq} > 四个
                                                    </label>
                                                    </div>
                                                </div>
                                                <div class="form-inline form-group relative">
                                                    <button type="button" class="btn glyphicon glyphicon-ok yellow iconArea_sure">确认</button><span class="" style="color:red"></span>
                                                </div>
                                                <button type="button" id="iconArea_btn" class="btn btn-success btn_add_class iconArea_btn"> 新增按钮导航</button><span class="help-block text-center" style="color:red"></span>
                                                <table class="table table-ban iconArea_talbe" id="iconArea_talbe{$key}">
                                                    <thead>
                                                        <tr>
                                                            <th>按钮图片</th>
                                                            <th>按钮名称</th>
                                                            <th>链接类型</th>
                                                            <th>排序</th>
                                                            <th>操作</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                    </tbody>
                                                </table>
                                            </div>
                                        {/case}
                                        {case value="4"}
                                            <!--分割线设置-->
                                            <div class="col-md-8 btn-nav-site site iconAreaList" id="list{$key}">
                                                <input name="componentId" type="hidden" value="" />
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span><button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4>分割线设置</h4>
                                                <div class="form-inline form-group  relative">

                                                </div>
                                            </div>
                                        {/case}
                                        {case value="5"}
                                            <!--视频设置-->
                                            <div class="col-md-8 btn-video-site site" id="list{$key}">
                                                <input name="componentId" type="hidden" value="" />
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span><button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4>视频模块设置</h4>
                                                <div class="form-group  relative">
                                                    <label class="control-label pull-left">视频标题：　</label>
                                                    <div class="col-md-6 col-xs-8 text_title form-inline" style="display: block;">
                                                        <input type="text" class="form-control input-medium" id="" name="frameName" value="{$vo.name}" maxlength="12">
                                                    </div>
                                                </div>
                                                <div class="form-group relative ">
                                                    <lable class="pull-left control-label">
                                                        视频封面：
                                                    </lable>
                                                    <div class="col-md-6 col-xs-8">
                                                        <div class="pull-left margin-left">
                                                            <a id="pickfiles{$key}"  class="pickfiles6" onclick="getAllPic(this,size='2')" href="javascript:void 0;"><img class="img-responsive" src="{$vo.imgUrl}" name="img_qiniu_url"/></a>
                                                        </div>
                                                        <small class="center-block pull-left margin-left">
                                                            图片推荐：尺寸690*370，大小不超过500k<br/>
                                                        </small>
                                                    </div>
                                                </div>

                                                <div class="form-group margin-top-10 relative">
                                                    <lable class="pull-left control-label">
                                                        视频上传：</lable>
                                                    <div class="col-md-6 col-xs-8">
                                                        <div  class="pull-left margin-right">
                                                            <a id="videofiles{$key}" class="pickfiles7" href="javascript:void 0;"><video class="img-responsive" name="img_qiniu_url" src="{$vo.videoUrl}" />  <source name="img_qiniu_url"  class="img-responsive" src="{$vo.videoUrl}"  type="video/mp4" /> </video></a>
                                                        </div>
                                                        <small class="center-block pull-left">视频要求：文件大小：10M以内文件格式：MP4<br />
                                                       </small> <span ><br /></span>
                                                      <span class="success_help pull-left" ></span>
                                                    </div>
                                                </div>

                                                <div class="form-inline form-group relative">
                                                    <label class="control-label pull-left"></label>
                                                    <div class="col-md-6 col-xs-8">
                                                        <button type="button" id="" class="btn glyphicon glyphicon-ok yellow video_sure_btn">确认</button><span class="" style="color:red"></span>
                                                    </div>
                                                </div>
                                            </div>
                                        {/case}
                                        {case value="6"}{/case}
                                        {case value="7"}{/case}
                                        {case value="8"}
                                            <!-- 自适应图片 -->
                                            <div class="col-md-8 btn-pic-site site" id="list{$key}">
                                                <input name="componentId" type="hidden" value="" />
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span>
                                                    <button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4>自适应图片设置</h4>
                                                <div class="form-group relative" style="display: none;">
                                                    <label class="control-label pull-left">模块标题：　</label>
                                                    <div class="col-md-6 col-xs-7 text_title form-inline"  style="display: block;">
                                                        <input type="text" class="form-control input-medium" id="frameName"  name="frameName" value="{$vo.name}" maxlength="12"/>
                                                    </div>
                                                </div>
                                                <div class="form-inline form-group relative" style="display: none;">
                                                    <label class="control-label pull-left"></label>
                                                    <div class="col-md-6 col-xs-7">
                                                        <button type="button" id="" class="btn glyphicon glyphicon-ok yellow pic_sure_btn">确认</button><span class="" style="color:red"></span>
                                                    </div>
                                                </div>
                                                <button type="button" id="pic_btn" class="btn btn-success btn_add_class pic_btn"> 新增图片</button><span class="help-block text-center" style="color:red"></span>
                                                <table class="table table-ban pic_ban_table" id="pic_ban_table{$key}">
                                                    <thead>
                                                    <tr>
                                                        <th> 图片</th>
                                                        <th> 链接</th>
                                                        <th> 排序</th>
                                                        <th> 操作</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    </tbody>
                                                </table>
                                            </div>
                                        {/case}
                                        {case value="9"}
                                            <!-- 代金券设置 -->
                                            <div class="col-md-8 btn-pro-site site"  id="list{$key}">
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span><button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4>代金券样式</h4>
                                                <div class="form-group relative" style="display: none;">
                                                    <label class="control-label pull-left">模块标题：　</label>
                                                    <div class="col-md-6 col-xs-7 text_title form-inline">
                                                        <input type="text" class="form-control input-medium" name="frameName" maxlength="12" value="{$vo.name}" />
                                                    </div>
                                                </div>
                                                <div class="form-group relative">
                                                    <span class="quan"><input type="radio" name="quan{$key}" value="1"  {eq name="vo.displayType" value="1"}checked{/eq} ><img src="__STATIC__/admin/pages/image/quan1.png" alt="" ></span>
                                                    <span class="quan"><input type="radio" name="quan{$key}" value="2" {eq name="vo.displayType" value="2"}checked{/eq} ><img src="__STATIC__/admin/pages/image/quan2.png" alt="" ></span>
                                                    <span class="quan"><input type="radio" name="quan{$key}" value="3" {eq name="vo.displayType" value="3"}checked{/eq} ><img src="__STATIC__/admin/pages/image/quan3.png" alt="" ></span>
                                                </div>
                                                <div class="form-inline form-group relative">
                                                    <label class="control-label pull-left"></label>
                                                    <div class="col-md-6 col-xs-7">
                                                        <button type="button" id="" class="btn glyphicon glyphicon-ok yellow quan_sure_btn">确认</button>
                                                    </div>
                                                </div>
                                            </div>
                                        {/case}
                                        {case value="10"}
                                            <!--推荐内容设置-->
                                            <div class="col-md-8 btn-pro-site site commoditylist"  id="list{$key}">
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span><button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4>推荐内容</h4>
                                                <div class="form-group relative" style="display: none;">
                                                    <label class="control-label pull-left">模块标题：　</label>
                                                    <div class="col-md-6 col-xs-7 text_title form-inline">
                                                        <input type="text" class="form-control input-medium" name="frameName" maxlength="12" value="{$vo.name}" />
                                                    </div>
                                                </div>
                                                <div class="form-group relative">
                                                    <label class="control-label pull-left">显示内容：　</label>
                                                    <div class="col-md-6 col-xs-7 contentType form-inline type10">
                                                        <select class="ctype" name="ctype" onchange="changeType(this)" >
                                                            <option value="1" {eq name="vo.contentType" value="1"}selected{/eq} >商品</option>
                                                            <option value="2" {eq name="vo.contentType" value="2"}selected{/eq} >文章</option>
                                                            <option value="3" {eq name="vo.contentType" value="3"}selected{/eq} >拼团</option>
                                                            <option value="4" {eq name="vo.contentType" value="4"}selected{/eq} >积分兑换</option>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="form-inline form-group relative">
                                                    <label class="control-label pull-left">显示布局：　</label>
                                                    <div class="col-md-6 col-xs-7 type10-buju">
                                                        <label class="radio-inline list">
                                                            <input type="radio" name="displayType{$key}" value="1" {eq name="vo.displayType" value="1"}checked{/eq} > 列表布局
                                                        </label>
                                                        <label class="radio-inline trell" >
                                                            <input type="radio" name="displayType{$key}" value="2" {eq name="vo.displayType" value="2"}checked{/eq} > 方格布局
                                                        </label>
                                                        <label class="radio-inline skip" >
                                                            <input type="radio" name="displayType{$key}" value="3" {eq name="vo.displayType" value="3"}checked{/eq} > 滑动布局
                                                        </label>
                                                    </div>
                                                </div>
                                                <div class="form-group relative">
                                                    <label class="control-label pull-left">排序方式：　</label>
                                                    <div class="col-md-6 col-xs-7 contentType form-inline">
                                                        <select class="orderType" name="orderType">
                                                            <option value="1" {eq name="vo.orderType" value="1"}selected{/eq} >最近发布时间</option>
                                                            <option value="2" {eq name="vo.orderType" value="2"}selected{/eq} >最多点击浏览</option>
                                                            <option value="3" {eq name="vo.orderType" value="3"}selected{/eq} >最多购买数量</option>
                                                            <option value="4" {eq name="vo.orderType" value="4"}selected{/eq} >自定义首页推荐</option>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="form-inline form-group relative">
                                                    <label class="control-label pull-left"></label>
                                                    <div class="col-md-6 col-xs-7">
                                                        <button type="button" class="btn glyphicon glyphicon-ok yellow updateName_btn">确认</button><span class="" style="color:red"></span>
                                                    </div>
                                                </div>
                                            </div>
                                        {/case}
                                        {case value="11"}
                                            <!--附近门店设置-->
                                            <div class="col-md-8 ban-site site nearbystore" id="list{$key}" >
                                                <input name="componentId" type="hidden" value="" />
                                                <div class="btn-group" style="display: block;">
                                                    <input name="frameId" value="{$vo.id}" type="hidden">
                                                    <span class="glyphicon glyphicon-move ui-sortable-handle"></span><button type="button" class="btn btn-xs btn_del_module glyphicon glyphicon-trash"></button>
                                                </div>
                                                <h4 style="color: #000;">附近门店设置</h4>
                                                <span class="help-block text-center" style="color: red"></span>
                                                <table class="table table-ban nearbystore_talbe" id="nearbystore_talbe{$moduleKey - 1}">
                                                    <thead>
                                                    <tr>
                                                        <th>门店图</th>
                                                        <th>门店名称</th>
                                                        <th>门店地址</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    </tbody>
                                                </table>
                                            </div>
                                        {/case}
                                    {/switch}
                                {/volist}
                            </div>

                            <div class="col-md-4 col-lg-3 Preview" id="preview" style="min-width: 350px;min-width: 350px;position: fixed;right: 5%;top: 14%;max-width: 400px;">
                                <div class="relative">
                                    <h5 class="text-center">手机预览</h5>
                                    <div class="applet-box preview col-md-12">
                                        <div class="top">
                                            <h4 class="text-center">{$tenant.name}</h4>
                                        </div>
                                        <div class="content">
                                            {volist name="list" id="vo"} {switch name="vo.type" } {case value="1" }
                                            <div class="relative con_mainList padding-bottom" id="con_mainList{$key}">  <!--轮播广告-->
                                                <div class="carousel slide banner" data-ride="carousel">
                                                    <div class="carousel-inner">
                                                        <div class="item">
                                                            <img class="img-responsive carousel-inner" style="height: 150px;" src="/public/static/admin/img/pop.png" alt="初始化轮播广告" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            {/case} {case value="2"}
                                            <div class="relative con_mainList"  id="con_mainList{$key}">   <!--按钮导航-->
                                                <div class="btn-nav padding-tb-20" id="iconArea">
                                                    <div class="row">
                                                        <div class="col-md-12 relative">
                                                            <div class="">
                                                                <div class="iconArea">
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            {/case} {case value="4"}
                                            <hr />
                                            {/case} {case value="5"}
                                            <div class="relative padding-bottom recom-video con_mainList" style="margin-top: 10px;">   <!--视频-->
                                                <div class="col-md-12 relative">
                                                    <div>
                                                        <div class="row">
                                                            <div>
                                                                <video width="305" height="180.6" controls="controls" preload="auto" poster="{$vo.imgUrl}">
                                                                    <source src="{$vo.videoUrl}" type="video/mp4" />
                                                                </video>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            {/case} {case value="8"}
                                            <div class="relative padding-bottom recom-pic con_mainList" id="con_mainList{$key}" style="">  <!--自适应图片-->
                                                <div class="col-md-12 relative">
                                                </div>
                                            </div>
                                            {/case} {case value="9"}
                                            <div class="relative con_mainList"  id="con_mainList{$key}">   <!--代金券列表-->
                                                <div class="quan_list">
                                                    {volist name="vo.sub" id="quan"}
                                                    <div class="left">
                                                        <div class="relative con{$vo.displayType}">
                                                            <span class="value{$vo.displayType}">{$quan.value2}</span>
                                                            <span class="condition{$vo.displayType}">{$quan.condition}</span>
                                                        </div>
                                                        <img src="{$vo.img}" alt="">
                                                    </div>
                                                    {/volist}
                                                </div>
                                            </div>
                                            {/case} {case value="10"}
                                            <div class="relative padding-bottom recom-pro con_mainList" id="con_mainList{$key}"><!--推荐内容-->
                                                <div class="col-md-12 relative">
                                                    <div class="row">
                                                    {switch name="vo.displayType" } {case value="1" }  <!-- 列表布局 -->
                                                    {volist name="vo.sub" id="list"}
                                                    <div>
                                                        <div>
                                                            <div class="col-md-12 relative">
                                                                <div class="article_small relative">
                                                                    <div class="con relative">
                                                                        <h5>{$list.displayName}</h5>
                                                                        <p>{if condition="$vo.contentType eq '2'"}{$list.createDate}{else /}￥{php}echo number_format($list->price/100,2);{/php}{/if}</p>
                                                                    </div>
                                                                    <img class="img-responsive carousel-inner" src="{$list.imgUrl}" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    {/volist}
                                                    {/case} {case value="2"}   <!-- 方格布局 -->
                                                    {volist name="vo.sub" id="square"}
                                                    <div>
                                                        <div>
                                                            <div class="col-md-6 col-xs-6 margin-bottom-10">
                                                                <img class="img-responsive carousel-inner" src="{$square.imgUrl}" style="width: 100px;height: 75px;" />
                                                                <h5 class="center-block">{$square.displayName}</h5>
                                                                <span>￥{php}echo number_format($square->price/100,2);{/php}</span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    {/volist}
                                                    {/case} {case value="3"}   <!-- 滑动布局 -->
                                                    <div class="skip">
                                                    {volist name="vo.sub" id="skip"}
                                                        <div class="left">
                                                            <img src="{$skip.imgUrl}" alt="">
                                                            <h5 class="center-block">{$skip.displayName}</h5>
                                                            <span>￥{php}echo number_format($skip->price/100,2);{/php}</span>
                                                        </div>
                                                    {/volist}
                                                    </div>
                                                    {/case}{/switch}
                                                    </div>
                                                </div>
                                            </div>
                                            {/case} {case value="11"}
                                            <div class="relative con_mainList"  id="con_mainList{$key}">   <!--附近门店-->
                                                <div class="col-md-12 relative">
                                                    <div class="row">
                                                        <div class="col-md-12 relative">
                                                            <div class="nearbystore">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            {/case}{/switch} {/volist}
                                        </div>
                                        <div class="row nav nav-pills">
                                            <div class="col-md-4 col-xs-3 navCon text-center">
                                                <img class="img-responsive" src="/public/static/assets/global/img/applet1.png" alt="ICON" />
                                                <span class="">推荐</span>
                                            </div>
                                            <div class="col-md-4 col-xs-3 navCon text-center">
                                                <img class="img-responsive" src="/public/static/assets/global/img/applet2.png" alt="ICON" />
                                                <span class="">购物</span>
                                            </div>
                                            <div class="col-md-4 col-xs-3 navCon text-center">
                                                <img class="img-responsive" src="/public/static/assets/global/img/applet4.png" alt="ICON" />
                                                <span class="">我的</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>

<!-- 弹框  添加模块-->
<div class="modal fade add-moduleCon" id="add-moduleCon" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                </button>
                <h4 class="modal-title">添加模块</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span class="glyphicon glyphicon-bullhorn"></span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-ban">轮播图</button>
                        </div>
                    </div>
                    <div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span class="glyphicon glyphicon glyphicon-th-large"></span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-nav">按钮导航</button>
                        </div>
                    </div>
                    <div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span data-icon="&#xe035;">荐</span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-pro">推荐内容</button>
                        </div>
                    </div>
                    <div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span class="ico_group">券</span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-quan">代金券</button>
                        </div>
                    </div>
                    <div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span class="glyphicon glyphicon-facetime-video"></span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-video">视频</button>
                        </div>
                    </div>
                    <div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span class="glyphicon glyphicon-picture"></span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-pic">自适应图片</button>
                        </div>
                    </div>
                    <!--<div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span class="glyphicon glyphicon-map-marker"></span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-nearbystore">附近门店</button>
                        </div>
                    </div>-->
                    <div class="col-md-3 module">
                        <div class="module-list relative">
                            <div class="media">
                                <span class="glyphicon glyphicon-resize-horizontal"></span>
                            </div>
                            <button type="button" class="btn btn-add btn-add-dividingline">分割线</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<!-- 弹框层-->
<div class="layer" >
    {include file="public/layer" /}
</div>
{/block}

{block name="pagescript"}
<script> 
    var component_url = "{:url('admin/wxindex/component')}";   //小程序模块内容配置
    var componentList_url = "{:url('admin/wxindex/componentList')}";  //根据frameId查询组件具体内容
    var componentDel_url = "{:url('admin/wxindex/componentDel')}"; 
    var wxFrameConf_url = "{:url('admin/wxindex/wxFrameConf')}";   //新增模块数据提交地址
    var wxFrameConfDel_url = "{:url('admin/wxindex/wxFrameConfDel')}";   //删除模块数据提交地址
    var FrameReqVideo_url ="{:url('admin/wxindex/FrameReqVideo')}";   //视频模块数据提交地址
    var move_url = "{:url('admin/wxindex/move')}";   //拖动排序
    var token_url = "{:url('admin/image/token')}";  //七牛图片token

    var record_url = "{:url('admin/image/record')}";

    var layer_product = "{:url('admin/layer/product')}";  //商品弹出层数据接口
    var layer_productType = "{:url('admin/layer/productType')}";  //商品分类弹出层数据接口
    var layer_groups = "{:url('admin/layer/groups')}";  //拼团商品弹出层数据接口
    var layer_articles = "{:url('admin/layer/articles')}";  //文章列表弹出层数据接口
    var layer_points = "{:url('admin/layer/points')}";  //积分商品列表弹出层数据接口
    var layer_storeList = "{:url('admin/layer/storeList')}";  //门店列表弹出层数据接口

    var layer_img = "{:url('admin/layer/img')}";  //图片组件

    var getstoreinfo_url = "{:url('admin/store/getStoreInfo')}"; // 获取门店信息
    var componentStoreList_url = "{:url('admin/wxindex/componentStoreList')}"; // 根据frameId查询组件具体内容（附近门店）

    
    function changeStore(e) {  //切换门店
        var id = e.value;
        console.log(id);
        location.href="{:url('admin/wxindex/index')}"+'?id='+id;
    }

    //若选择为文章，则隐藏另外两种布局
    $("div.type10 .ctype option").each(function(){
        if ($(this).val() == 2 && $(this).is(":checked")) {
            $(this).parent().parent().parent().next().find('.trell').hide();
            $(this).parent().parent().parent().next().find('.skip').hide();

            $('.orderType').find('option[value=3]').hide();
        }
    });

    var storeId = $('#store').find("option:selected").val();

    function changeType(e) {  //模块类型为10的推荐内容选择
        if(e.value == 2) {  //若选择文章，则仅有列表布局
            $(e).parent().parent().next().find('.trell').hide();
            $(e).parent().parent().next().find('.skip').hide();
            $(e).parent().parent().next().find('.list input').prop('checked',true);

            $('.orderType').val(1);
            $('.orderType').find('option[value=3]').hide();
            $('.orderType').find('option[value=2]').show();
        }else {
            $('.commoditylist .trell').show();
            $('.commoditylist .skip').show();

            $('.orderType').val(1);
            $('.orderType').find('option[value=3]').show();
            $('.orderType').find('option[value=2]').hide();
        }

        $.ajax({
            url : "{:url('admin/wxindex/checkRecommendation')}",
            type : 'POST',
            dataType : 'json',
            contentType:"application/json; charset=utf-8",
            data : JSON.stringify({'type':e.value,'storeId':storeId}),
        }).done(function(data) {
            if (data.code === '2') {
                layer.msg(data.message);
            }
        });
    }
</script>
<script src="__STATIC__/admin/js/bootbox.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/include.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/jquery-ui.min.js"></script>
<script src="__STATIC__/admin/js/colpick.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/wxindex.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/appletLayer.js" type="text/javascript"></script>
{/block}